<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
    <link href="/center/static/css/comm.css" rel="stylesheet" type="text/css">
    <link href="/center/static/css/child.css" rel="stylesheet" type="text/css">
	</head>
	<body>
    <div class="main" id="main" v-cloak v-if="utoken">
     <div class="hd">
       <h1>友链管理</h1>
     </div>
     <div class="mc">
       <div class="sc">
         <button type="button" class="btnblue" @click="query">刷新</button>
       </div>
       <div class="sm">
         <div class="slist" v-if="list[0]">
           <div class="slci frili" v-for="item in list">
             <div class="slbn">
               <img :src="item.ficon" />
             </div>
             <div class="slti">
               <h2>{{ item.fname }} · <a target="_blank" :href="item.furl">{{ item.furl }}</a>  
               <span v-if="item.status == 0" class="clgray">{{statusNames[item.status]}}</span>
               <span v-if="item.status == 1" class="clblue">{{statusNames[item.status]}}</span>
               <span v-if="item.status == 2" class="clred">{{statusNames[item.status]}}</span>
               <span>{{ item.findex == 0 ? '普链' : '首链' }}</span>
                </h2>
               <p>{{ item.fdesc }}</p>
             </div>
             <button type="button" v-if="item.status == 0" class="do btnblue" @click="edit(item)">审核</button>
           </div>
         </div>
         <div class="slist" v-else>
            <p class="nuli">暂未检索到相关内容</p>
         </div>
       </div>
       <div class="spage" v-if="search.pages <= 7">
         <div v-for="n in search.pages" class="spi" :class="{'ck':search.page == n}" @click="toPage(n)">{{n}}</div>
       </div>
       <div class="spage" v-if="search.pages > 7 && search.page <5">
         <div v-for="n in 5" class="spi" :class="{'ck':search.page == n}" @click="toPage(n)">{{n}}</div>
         <div class="spi" @click="toPage(6)">...</div>
         <div class="spi" @click="toPage(search.pages)">{{search.pages}}</div>
       </div>
       <div class="spage" v-if="search.pages > 7 && search.page >=5 && search.page <= search.pages - 4">
         <div class="spi" @click="toPage(1)">1</div>
         <div class="spi" @click="toPage(search.page-2)">...</div>
         <div class="spi" @click="toPage(search.page-1)">{{search.page-1}}</div>
         <div class="spi ck" @click="toPage(search.page)">{{search.page}}</div>
         <div class="spi" @click="toPage(search.page+1)">{{search.page+1}}</div>
         <div class="spi" @click="toPage(search.page+2)">...</div>
         <div class="spi" @click="toPage(search.pages)">{{search.pages}}</div>
       </div>
       <div class="spage" v-if="search.pages > 7 && search.page >=5 && search.page > search.pages - 4">
         <div class="spi" @click="toPage(1)">1</div>
         <div class="spi" @click="toPage(search.pages - 5)">...</div>
         <div class="spi" :class="{'ck':search.page == search.pages - 4}" @click="toPage(search.pages - 4)">{{search.pages-4}}</div>
         <div class="spi" :class="{'ck':search.page == search.pages - 3}" @click="toPage(search.pages - 3)">{{search.pages-3}}</div>
         <div class="spi" :class="{'ck':search.page == search.pages - 2}" @click="toPage(search.pages - 2)">{{search.pages-2}}</div>
         <div class="spi" :class="{'ck':search.page == search.pages - 1}" @click="toPage(search.pages - 1)">{{search.pages-1}}</div>
         <div class="spi" :class="{'ck':search.page == search.pages}" @click="toPage(search.pages)">{{search.pages}}</div>
       </div>
     </div>
     <div class="pope popd">
       <div class="tage comme">
         <div class="tse">
           <h5>编辑友链</h5>
           <div class="tade">站点链接：<a target="_blank" :href="item.furl">{{ item.furl }}</a></div>
           <div class="tade">站点名称：<input type="text" v-model="item.fname" /></div>
           <div class="tade">站点图标：<input type="text" v-model="item.ficon" /></div>
           <div class="tade">友链类型：
           <select v-model="item.findex">
            <option :value ="0">仅申请友链</option>
            <option :value ="1">同时申请首页友链</option>
           </select>
           </div>
           <div class="tade">站点简介：<textarea placeholder="" v-model="item.fdesc"></textarea></div>
           <div class="tade">驳回原因：<input type="text" v-model="item.reson" /></div>
           <button type="button" class="btnblue" @click="save(1)">审核通过</button>
           <button type="button" class="btnred" @click="save(2)">审核驳回</button>
           <button type="button" class="btngray" @click="clsPop">取消</button>
         </div>
       </div>
     </div>
    </div>
    <script src="/static/lib/jquery/jquery-3.6.0.min.js"></script>
    <script src="/static/lib/vue/vue.min.js"></script>
    <script src="/static/lib/vue/vue-axios.js"></script>
    <script src="/static/lib/vue/axios.min.js"></script>
    <script src="/center/static/js/comm.js?v=1.0"></script> 
     <script src="/center/static/js/api.js"></script>
     <script src="/static/js/popup.js"></script>  
    <script src="/center/static/js/firends.js?v=1.0"></script>  
	</body>
</html>